import React from 'react';
import ReactDOM from 'react-dom';
import '../static/tero/pop.less';
// import '../../static/tero/pop.less';
import $ from 'jquery'


class Pop extends React.Component{
    constructor(props){
        super(props)
        this.state = {
            flag:2,
            display:'none',
            list:[{index:0,title:'提示',content:'是否需要加入样本？'},
            {index:2,title:'删除',content:'是否需要删除这条信息?'},
            {index:2,title:'研判',content:'确定要将这条信息研判为舆情/案件/情报吗？'},
            {index:0,title:'提示',content:'确定要清空选中的信息么？'},
            {index:0,title:'提示',content:'请先选择信息后再进行操作'},
            {index:0,title:'提示',content:'是否需要加入样本？'},
            {index:0,title:'提示',content:'是否需要删除这条信息?'},
            {index:0,title:'提示',content:'确定将信息导出么?'},
            {index:0,title:'提示',content:'确定将信息已阅么?'},
            {index:2,title:'研判',content:'确定要将这条信息研判为舆情/案件/情报吗？'},
            {index:2,title:'研判',content:'确定要将这条信息研判为舆情/案件/情报吗?'},
        ]
        }
       
    }
    componentWillMount(){
        this.setState((prevState, props)=>({
            display:this.props.display
        }))
        console.log(this.props.colse)
       
    }
    componentDidMount(){
        $(window).resize(function () {          
           $('.pop').css({height:document.body.offsetHeight,width:document.body.offsetWidth})
        });
    }
  
    render(){
        return (
            <div className='pop' style={{height:document.body.offsetHeight,width:document.body.offsetWidth,display:this.props.display}}>
                <div className='popson' >
                 <div className='popson_son' style={{position:'relative'}}>
                 {
                    this.state.list[this.props.index].index == 0? <img src={require('../static/image/pop_icon1.png')} alt=""/>:(this.state.list[this.props.index].index == 1?<img src={require('../static/image/pop_icon2.png')}/>:<img src={require('../static/image/pop_icon3.png')}/>)
                 }
                           
                            <span className='ti'>{this.state.list[this.props.index].title}</span>
                            <img onClick={()=>{this.props.colse('none')}} src={require('../static/image/X_nor.png')} alt="" style={{position:'absolute',right:'0px',top:'8px',cursor:'pointer'}}/>
                            <p dangerouslySetInnerHTML={{__html:this.state.list[this.props.index].content}}></p>
                            <div className='btn'><span onClick={()=>{this.props.colse('none')}}>取消</span><span onClick={()=>{this.props.colse('none',this.props.index)}}>确定</span></div>
                        </div>: <div></div>   
                </div>
            </div>
        )
    }
}


export default Pop